home *** CD-ROM | disk | FTP | other *** search
- unit DMSQLBDE;
-
- interface
-
- uses
- Classes, DMSQLBase, DBTables;
-
- type
- // A TQuery that can change its where clause.
- TDMSQLQuery = class(TQuery, IDMSQLQuery)
- private
- FImplementor: TDMSQLQueryImpl;
- procedure AfterBuild(Sender: TDMSQLQueryImpl);
- procedure BeforeBuild(Sender: TDMSQLQueryImpl);
- procedure SetSQLText(Value: string);
- protected
- procedure Loaded; override;
- public
- constructor Create(AOwner: TComponent); override;
- published
- property Implementor: TDMSQLQueryImpl read FImplementor write FImplementor;
- end;
-
- implementation
-
- uses
- DMSQLUtils;
-
- { TDMSQLQuery }
-
- constructor TDMSQLQuery.Create(AOwner: TComponent);
- begin
- inherited;
- FImplementor := TDMSQLQueryImpl.Create(Self);
- end;
-
- procedure TDMSQLQuery.BeforeBuild(Sender: TDMSQLQueryImpl);
- begin
- end;
-
- procedure TDMSQLQuery.AfterBuild(Sender: TDMSQLQueryImpl);
- begin
- if sqlOpenAfterBuild in Sender.SQLOptions then
- Open;
- end;
-
- procedure TDMSQLQuery.Loaded;
- begin
- inherited;
- FImplementor.BaseSQL := SQL;
- end;
-
- procedure TDMSQLQuery.SetSQLText(Value: string);
- begin
- SQL.Text := Value;
- end;
-
- end.
-